<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }
        
        table {
            width: 300px;
            margin: 100px auto;
            text-align: center;
            border-collapse: collapse;
        }
        
        tr,
        th,
        td {
            border: 1px solid black;
        }
        
        thead tr {
            height: 40px;
            background-color: grey;
        }
    </style>
</head>

<body>
    <table>
        <thead>
            <tr>
                <th>姓名</th>
                <th>科目</th>
                <th>成绩</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>张飞</td>
                <td>数学</td>
                <td>80</td>
                <td><a href="javascript:;" ">删除</a></td>
            </tr>
            <tr>
                <td>赵云</td>
                <td>数学</td>
                <td>80</td>
                <td><a href="javascript:; "">删除</a>
                </td>
            </tr>
            <tr>
                <td>刘备</td>
                <td>数学</td>
                <td>80</td>
                <td>
                    <a href="javascript:;" ">删除</a></td>
            </tr>
            <tr>
                <td>关羽</td>
                <td>数学</td>
                <td>80</td>
                <td><a href="javascript:; ">删除</a></td>
            </tr>
        </tbody>
    </table>
    <script>
        var as = document.querySelectorAll('a');
        var tbody = document.querySelector('tbody');
        for (let i = 0; i < as.length; i++) {
            as[i].onclick = function() {
                tbody.removeChild(this.parentNode.parentNode);
            }
        }
    </script>
</body>

</html>